package org.example.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.entity.User;
import org.example.http.Result;
import org.example.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "用户接口")
@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @ApiOperation("查询所有用户")
    @RequestMapping("/users")
    public Result users() {
        List<User> list = userService.list();
        return new Result(0, "", list);
    }

    public void test() {

    }

}
